cmake_minimum_required (VERSION 2.8)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

project (Tacticus)

add_subdirectory(${CMAKE_SOURCE_DIR}/src)

add_executable (tacticus WIN32 ${TACTICUS_SOURCES})

set(SFML_ROOT "" CACHE PATH "Path to SFML dir")
if (EXISTS ${CMAKE_SOURCE_DIR}/dependencies/sfml)
    set (SFML_ROOT ${CMAKE_SOURCE_DIR}/dependencies/sfml)
endif()
set(BOOST_ROOT "" CACHE PATH "Path to Boost dir")
if (EXISTS ${CMAKE_SOURCE_DIR}/dependencies/boost)
    set (BOOST_ROOT ${CMAKE_SOURCE_DIR}/dependencies/boost)
endif()

find_package (SFML 2 COMPONENTS audio graphics network system window REQUIRED)
find_package (SFML 2 COMPONENTS main)
find_package (Boost REQUIRED)

include_directories (${CMAKE_SOURCE_DIR}/src ${SFML_INCLUDE_DIR}
    ${Boost_INCLUDE_DIRS})

target_link_libraries (tacticus ${SFML_LIBRARIES} ${Boost_LIBRARIES})

install (TARGETS tacticus DESTINATION Tacticus)
install (DIRECTORY ${CMAKE_SOURCE_DIR}/resources DESTINATION Tacticus)
install (FILES ${CMAKE_SOURCE_DIR}/media/Jomolhari.ttf
    DESTINATION Tacticus/resources/)
install (FILES ${CMAKE_SOURCE_DIR}/README.txt ${CMAKE_SOURCE_DIR}/LICENSE.txt
    ${CMAKE_SOURCE_DIR}/OFL.txt DESTINATION Tacticus)
